<script src="jquery-1.8.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
  
  jQuery(document).ready(function(){
    // By Id
    jQuery('#clickId').click(function(){    
      alert("yes :) I am called By Id");
    });
    // By Class
    jQuery('.clickClass').click(function(){    
      alert("yes :) I am called By Class");
    });
    
  });
  
</script>

<p>
  <a href="#" id="clickId">click me</a>
</p>

<p>
  <a href="#" class="clickClass">click me</a>
</p>